#pragma once

#include <map>

#define BSP_RESOURCE_PATH "BSP_RESOURCE_PATH"
#define DR1X90_CFG_FILE_NAME "dr1x90_depend.json"
#define PH1P35_CFG_FILE_NAME "ph1p35_depend.json"

#define CHIP_DR1M90 "dr1m90"
#define CHIP_DR1V90 "dr1v90"
#define CHIP_PH1P35 "ph1p35"

#define PROC_APU "apu"
#define PROC_RPU "rpu"

#define DR1_CPU0 "apu-0"
#define DR1_CPU1 "apu-1"
#define DR1_CPU2 "rpu"
#define PH1P35_CPU "rpu"

#define DR1_CPU0_NAME "dr1m90_fpsoc_cpu0"
#define DR1_CPU1_NAME "dr1m90_fpsoc_cpu1"
#define DR1_CPU2_NAME "dr1v90_fpsoc_cpu0"
#define PH1P35_CPU_NAME "ph1p35_fpsoc_cpu"

#define OS_LINUX "linux"
#define OS_STANDALONE "standalone"
#define OS_FREERTOS "freertos"
#define OS_RTTHREAD "rtthread"

static std::map<std::string, std::string> CFG_DRIVER_DEFINITION = {
    {"Quad_SPI_Flash", "PS_DRIVER_QSPI"},
    {"NAND_Flash", "PS_DRIVER_SMC"},
    {"ETH0", "PS_DRIVER_GBE"},
    {"ETH1", "PS_DRIVER_GBE"},
    {"USB0", "PS_DRIVER_USB"},
    {"USB1", "PS_DRIVER_USB"},
    {"SD0", "PS_DRIVER_MMC"},
    {"SD1", "PS_DRIVER_MMC"},
    {"UART0", "PS_DRIVER_UART"},
    {"UART1", "PS_DRIVER_UART"},
    {"I2C0", "PS_DRIVER_IIC"},
    {"I2C1", "PS_DRIVER_IIC"},
    {"SPI0", "PS_DRIVER_SPI"},
    {"SPI1", "PS_DRIVER_SPI"},
    {"CAN0", "PS_DRIVER_CAN"},
    {"CAN1", "PS_DRIVER_CAN"},
    {"GPIO_PS", "PS_DRIVER_GPIO"},
    {"GPIO_PL", "PL_DRIVER_GPIO"},
    {"Timer0", "PS_DRIVER_TTC"},
    {"Timer1", "PS_DRIVER_TTC"},
    {"Watchdog", "PS_DRIVER_WDT"},
    {"CIPHER", "PS_DRIVER_CIPHER"},
};

static std::map<std::string, std::string> SDK_DRIVER_DEFINITION = {
    {"Quad_SPI_Flash", "QSPIPS_DRIVER"},
    {"NAND_Flash", "SMCPS_DRIVER"},
    {"ETH0", "GBEPS_DRIVER"},
    {"ETH1", "GBEPS_DRIVER"},
    {"USB0", "USBPS_DRIVER"},
    {"USB1", "USBPS_DRIVER"},
    {"SD0", "MMCPS_DRIVER"},
    {"SD1", "MMCPS_DRIVER"},
    {"UART0", "UARTPS_DRIVER"},
    {"UART1", "UARTPS_DRIVER"},
    {"I2C0", "IICPS_DRIVER"},
    {"I2C1", "IICPS_DRIVER"},
    {"SPI0", "SPIPS_DRIVER"},
    {"SPI1", "SPIPS_DRIVER"},
    {"CAN0", "CANPS_DRIVER"},
    {"CAN1", "CANPS_DRIVER"},
    {"GPIO_PS", "GPIOPS_DRIVER"},
    {"GPIO_PL", "GPIOPL_DRIVER"},
    {"Timer0", "TTCPS_DRIVER"},
    {"Timer1", "TTCPS_DRIVER"},
    {"Watchdog", "WDTPS_DRIVER"},
    {"CIPHER", "CIPHERPS_DRIVER"},
};

enum {
    CFG_DRIVER = 0,
    SDK_DRIVER,
};
